#include <iostream>

/*
    一维数组的定义有三种方式

    1、 数据类型 数组名[数组长度];

    2、 数据类型 数组名[数组长度] = {value1, value2, value3};

    3、 数据类型 数组名[] = {value1, value2, value3};
*/
int main(int argc, char const *argv[])
{
    using namespace std;

    cout << "1. DataType ArrayName[N];" << endl;
    int arr1[5];
    arr1[0] = 10;
    arr1[1] = 20;
    arr1[2] = 30;
    arr1[3] = 40;
    arr1[4] = 50;

    for (int i = 0; i < 5; i++)
    {
        cout << arr1[i] << endl;
    }

    cout << "2. DataType ArrayName[N] = {1, ...};" << endl;
    int arr2[5] = {1, 2, 3, 4};

    for (int i = 0; i < 5; i++)
    {
        cout << arr2[i] << endl;
    }

    cout << "3. DataType ArrayName[] = {value1, value2, value3...}" << endl;
    int arr3[] = {1, 2, 3, 4, 5, 6};

    for (int i = 0; i < 6; i++)
    {
        cout << arr3[i] << endl;
    }

    return 0;
}
